#include<iostream>
using namespace std;

double E[1001];
int main(){
	int N;double e;int D;
	cin>>N>>e>>D;
	int ky=0,y=0;
	int n=N;
	while(n--){
		int K;int y_d=0;
		cin>>K;
		for(int i=0;i<K;i++){
			cin>>E[i];if(E[i]<e)y_d++;
		}
		if(y_d>K/2){
			K>D?y++:ky++;
		}
	}
	printf("%2.1lf%% %2.1lf%%\n",100*double(ky)/N,100*double(y)/N);
}
